package com.minimalist.common.feign.client.lindi;

import com.minimalist.common.config.mybatis.bo.PageResp;
import com.minimalist.common.entity.lindi.vo.contracttemplatefieldoption.LindiContractTemplateFieldOptionQueryVO;
import com.minimalist.common.entity.lindi.vo.contracttemplatefieldoption.LindiContractTemplateFieldOptionVO;
import com.minimalist.common.feign.config.FeignConfig;
import com.minimalist.common.feign.fallback.lindi.LindiContractTemplateFieldOptionFeignClientFallbackFactory;
import com.minimalist.common.response.R;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 林地指标平台_合同模板字段选项 Feign 客户端
 *
 * @author 11987
 */
@FeignClient(name = "minimalist-lindi"
        , contextId = "lindiContractTemplateFieldOptionFeignClient"
        , path = "/minimalist/lindi/contractTemplateFieldOption"
        , configuration = FeignConfig.class
        , fallbackFactory = LindiContractTemplateFieldOptionFeignClientFallbackFactory.class)
public interface LindiContractTemplateFieldOptionFeignClient {
    /**
     * 添加合同模板字段选项
     *
     * @param contractTemplateFieldOptionVO 合同模板字段选项信息
     * @return 成功或失败
     */
    @PostMapping("/addContractTemplateFieldOption")
    @Operation(summary = "添加合同模板字段选项")
    R<?> addContractTemplateFieldOption(
            @RequestBody @Validated(Add.class)
            LindiContractTemplateFieldOptionVO contractTemplateFieldOptionVO);

    /**
     * 删除合同模板字段选项 -> 根据合同模板字段选项ID删除
     *
     * @param contractTemplateFieldOptionId 合同模板字段选项ID
     * @return 成功或失败
     */
    @DeleteMapping("/deleteContractTemplateFieldOptionByContractTemplateFieldOptionId")
    @Operation(summary = "删除合同模板字段选项 -> 根据合同模板字段选项ID删除")
    R<?> deleteContractTemplateFieldOptionByContractTemplateFieldOptionId(
            @RequestParam("contractTemplateFieldOptionId")
            @NotNull(message = "合同模板字段选项ID不能为空")
            @Parameter(name = "contractTemplateFieldOptionId", required = true, description = "合同模板字段选项ID")
            Long contractTemplateFieldOptionId);

    /**
     * 修改合同模板字段选项
     *
     * @param contractTemplateFieldOptionVO 合同模板字段选项信息
     * @return 成功或失败
     */
    @PutMapping("/updateContractTemplateFieldOptionByContractTemplateFieldOptionId")
    @Operation(summary = "修改合同模板字段选项")
    R<?> updateContractTemplateFieldOptionByContractTemplateFieldOptionId(
            @RequestBody @Validated(Update.class)
            LindiContractTemplateFieldOptionVO contractTemplateFieldOptionVO);

    /**
     * 查询合同模板字段选项列表(分页)
     *
     * @param queryVO 查询条件
     * @return 合同模板字段选项列表
     */
    @GetMapping("/getPageContractTemplateFieldOptionList")
    @Operation(summary = "查询合同模板字段选项列表(分页)")
    R<PageResp<LindiContractTemplateFieldOptionVO>> getPageContractTemplateFieldOptionList(
            @RequestBody LindiContractTemplateFieldOptionQueryVO queryVO);

    /**
     * 根据合同模板字段选项ID查询合同模板字段选项
     *
     * @param contractTemplateFieldOptionId 合同模板字段选项ID
     * @return 合同模板字段选项
     */
    @GetMapping("/getContractTemplateFieldOptionByContractTemplateFieldOptionId/{contractTemplateFieldOptionId}")
    @Operation(summary = "根据合同模板字段选项ID查询合同模板字段选项")
    R<LindiContractTemplateFieldOptionVO> getContractTemplateFieldOptionByContractTemplateFieldOptionId(
            @PathVariable(value = "contractTemplateFieldOptionId")
            @NotNull(message = "合同模板字段选项ID不能为空")
            @Parameter(name = "contractTemplateFieldOptionId", description = "合同模板字段选项ID", required = true)
            Long contractTemplateFieldOptionId);
}